package com.bottle.enity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author: chenyuncong
 * @Date: 2020/4/29 18:01
 */

@Data
@Document(collection = "s_user")
//@CompoundIndexes({
//        @CompoundIndex(name = "i_account_password",def = "{'account':1,'password':1}", unique = true)
//})
public class User {
    @Id
    private String id;

    @Indexed(unique = true)
    private String encrUserId;

    //账号设置唯一索引
    @Indexed(unique = true)
    private String account; //账号

    private String password; //密码

    private String name; //姓名

    private String email; //邮件

    private String sex; //性别

    private Long createTime; //创建时间

    @Indexed(unique = true)
    private String phone;//手机

    private Boolean isDel; //是否删除
}
